package com.itmayiedu.api.service.impl;

import com.itmayiedu.api.service.TestApiService;
import com.itmayiedu.base.BaseApiService;
import com.itmayiedu.base.ResponseBase;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author cht 【wonderfor@vip.qq.com】
 * @Date 2018/10/18
 */
@RestController
public class TestApiServiceImpl extends BaseApiService implements TestApiService{
    @Override
    public Map<String, Object> test(Integer id, String name) {
        Map<String, Object> result = new HashMap<>();
        result.put("errorCode", 200);
        result.put("msg", "success");
        result.put("data", new String[]{"123456","6444600014", id + "", name});
        return result;
    }

    @Override
    public ResponseBase testResponseBase() {
        return setResultSuccess();
    }

    @Override
    public ResponseBase setTestRedis(String key, String value) {
        baseRedisService.setString(key, value, null);
        return setResultSuccess();
    }
}
